import React, { Component } from 'react'
import {Route,NavLink} from 'react-router-dom'
// import Page1 from './page1'
// import Page2 from './page2'

const Page1 = React.lazy(()=>import('./page1'))
const Page2 = React.lazy(()=>import('./page2'))
export default class wenzhang extends Component {
    render() {
        return (
            <div className='name'>
                
                <div>
                    <NavLink to='/wenzhang/page1'>文章1</NavLink>
                    &nbsp;&nbsp;&nbsp;
                    <NavLink to='/wenzhang/page2'>文章2</NavLink>
                    {/* <button onClick={()=>{
                        this.props.history.goBack()
                    }}>goBack</button>
                    <button onClick={()=>{
                        this.props.history.goForward()
                    }}>goForward</button>
                    <button onClick={()=>{
                        this.props.history.go(-2)
                    }}>go(-2)</button>
                    <button onClick={()=>{
                        this.props.history.push('./page2')
                    }}>push</button> */}
                </div>
                
                <React.Suspense fallback='wait...'>
                    <Route path='/wenzhang/page1' component={Page1}></Route>

                    <Route path='/wenzhang/page2' component={Page2}></Route>
                </React.Suspense>
                
            </div>
        )
    }
}
